<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=divice-width,initial-scale=1.0">
	<title>对象简写</title>
</head>
<body>
	<script type="text/javascript">
		//原始
		let name = '小明';
		let address = '廊坊';
		let link = 'http://www.baidu.com';
		let person = {
			name : name,
			address : address,
			link : link,
			go : function(){
				console.log('我骑着小单车');
			}
		};
		//简化
		//对象以key:val形式存在
		//1. 如果 key 和 变量名名字一直，可以只定义一次
		//2. 如果val是一个函数，可以把":function"全部去掉，只保留括号
		let name = '小明';
		let address = '廊坊';
		let link = 'http://www.baidu.com';
		let person = {
			name ,
			address ,
			link ,
			go(){
				console.log('我骑着小单车');
			}
		};
	</script>
</body>
</html>